<?php

Route::get('login', 'Auth\LoginController@showLoginForm')->name('login');
Route::post('login', 'Auth\LoginController@login');
Route::post('logout', 'Auth\LoginController@logout')->name('logout');

Route::group(['namespace' => 'Backend', 'middleware' => 'auth'], function ($api) {
    $api->get('/', 'HomeController@index')->name('home');
    $api->resource('users', 'UserController');

    $api->resource('role', 'RoleController');

    $api->resource('teacher', 'TeacherController');

    $api->get('top-teacher', ['as' => 'top.teacher', 'uses' => 'TeacherController@teacherTop']);

    $api->resource('category', 'CategoryController');

    $api->get('orders/export', ['uses' => 'OrderController@export', 'as' => 'orders.export']);
    $api->get('orders/cities', ['uses' => 'OrderController@getCities', 'as' => 'orders.cities']);
    $api->get('orders/areas', ['uses' => 'OrderController@getAreas', 'as' => 'orders.areas']);
    $api->resource('orders', 'OrderController');

    $api->resource('video', 'VideoController');

    $api->resource('media', 'FileController');

    $api->resource('qi-niu-config', 'QiNiuConfigController');

    $api->resource('advertisement', 'AdvertisementController');

    $api->get('customer', ['uses' => 'CustomerController@index', 'as' => 'customer.index']);

    $api->post('upload', ['uses' => 'UploadController@upload', 'as' => 'upload']);

    $api->get('queue', ['uses' => 'UploadController@queue', 'as' => 'queue']);


    $api->resource('wechat', 'WecahtController', ['except' => ['index', 'update', 'show', 'edit', 'destroy']]);

    $api->resource('about', 'AboutController', ['except' => ['index', 'update', 'show', 'edit', 'destroy']]);
});